import { defineConfig } from '@umijs/max';

export default defineConfig({
  base: "/aiagent/",
  publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
  antd: {},
  access: {},
  model: {},
  initialState: {},
  request: {},
  layout: false,
  routes: [
    { 
      path: '/login', 
      component: 'login', 
      layout: false 
    },
    {
      path: '/',
      component: '@/layouts/BasicLayout',
      routes: [
        { path: '/', redirect: '/users' },
        { path: '/users', component: 'users' },
        { path: '/tasks', component: 'tasks' },
        { path: '/contents', component: 'contents' },
        { path: '/aitest', component: 'aitest' },
      ],
    },
  ],
  npmClient: 'npm',
  proxy: {
    '/agentapi': {
      target: 'https://1.94.121.21',
      changeOrigin: true,
      secure: false,
      pathRewrite: {
        '^/agentapi': '/api',
      },
    },
    '/agentai': {
      target: 'http://113.45.180.111:8005',
      changeOrigin: true,
      pathRewrite: {
        '^/agentai': '',
      },
    },
  },
}); 